package kr.co.itatech.android;

import android.widget.*;
import kr.co.itatech.android.manager.*;

public class MainActivity extends BaseActivity {

    private TextView id;
    private TextView pw;
    
    @Override
    public int createLayout() {
        return R.layout.activity_main;
    }
    
    @Override
    public void initLayout() {
        id = (TextView) findViewById(R.id.userID);
        pw = (TextView) findViewById(R.id.userPW);
    }

    @Override
    public int checkValue() {
        //벨리데이션 체크
        //true일 경우 return PROC_OK
        //return PROC_OK;
        //실패인 경우 return ErrorStringId
        //return ErrorStringId;
        
        //예제
        if (id.length() < 6) {
            return R.string.err_string_sample;
        }
        if (pw.length() < 4) {
            return R.string.err_string_sample;
        }
        
        return PROC_OK;
    }

    @Override
    public void clickEvent(int id) {
        switch (id) {
        case R.id.button1:
            goNextActivity(TestBActivity.class);
            break;

        default:
            break;
        }
        
    }

}
